/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package idea.model.qnrlibrary;


import java.io.Serializable;
import java.util.Collection;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;


/**
 *
 * @author rejun001
 */
@Entity
@Table( name = "electronic_attribute_group" )
@XmlRootElement
@NamedQueries( 
{
    @NamedQuery( name = "ElectronicAttributeGroup.findAll" , query = "SELECT e FROM ElectronicAttributeGroup e" ) ,
    @NamedQuery( name = "ElectronicAttributeGroup.findByAgId" , query = "SELECT e FROM ElectronicAttributeGroup e WHERE e.agId = :agId" ) ,
    @NamedQuery( name = "ElectronicAttributeGroup.findByAgName" , query = "SELECT e FROM ElectronicAttributeGroup e WHERE e.agName = :agName" ) ,
    @NamedQuery( name = "ElectronicAttributeGroup.findByMaxLength" , query = "SELECT e FROM ElectronicAttributeGroup e WHERE e.maxLength = :maxLength" ) ,
    @NamedQuery( name = "ElectronicAttributeGroup.findByMinLength" , query = "SELECT e FROM ElectronicAttributeGroup e WHERE e.minLength = :minLength" ) ,
    @NamedQuery( name = "ElectronicAttributeGroup.findByHighValueNum" , query = "SELECT e FROM ElectronicAttributeGroup e WHERE e.highValueNum = :highValueNum" ) ,
    @NamedQuery( name = "ElectronicAttributeGroup.findByLowValueNum" , query = "SELECT e FROM ElectronicAttributeGroup e WHERE e.lowValueNum = :lowValueNum" ) ,
    @NamedQuery( name = "ElectronicAttributeGroup.findByInitialValue" , query = "SELECT e FROM ElectronicAttributeGroup e WHERE e.initialValue = :initialValue" ) ,
    @NamedQuery( name = "ElectronicAttributeGroup.findByIgnoreRegExp" , query = "SELECT e FROM ElectronicAttributeGroup e WHERE e.ignoreRegExp = :ignoreRegExp" ) ,
    @NamedQuery( name = "ElectronicAttributeGroup.findByValidRegExp" , query = "SELECT e FROM ElectronicAttributeGroup e WHERE e.validRegExp = :validRegExp" ) ,
    @NamedQuery( name = "ElectronicAttributeGroup.findByJustification" , query = "SELECT e FROM ElectronicAttributeGroup e WHERE e.justification = :justification" ) ,
    @NamedQuery( name = "ElectronicAttributeGroup.findByUseInBehavior" , query = "SELECT e FROM ElectronicAttributeGroup e WHERE e.useInBehavior = :useInBehavior" ) ,
    @NamedQuery( name = "ElectronicAttributeGroup.findByOptionGroupParent" , query = "SELECT e FROM ElectronicAttributeGroup e WHERE e.optionGroupParent = :optionGroupParent" ) ,
    @NamedQuery( name = "ElectronicAttributeGroup.findByOptionGroupChild" , query = "SELECT e FROM ElectronicAttributeGroup e WHERE e.optionGroupChild = :optionGroupChild" ) ,
    @NamedQuery( name = "ElectronicAttributeGroup.findByDateCreated" , query = "SELECT e FROM ElectronicAttributeGroup e WHERE e.dateCreated = :dateCreated" ) ,
    @NamedQuery( name = "ElectronicAttributeGroup.findByCreatedBy" , query = "SELECT e FROM ElectronicAttributeGroup e WHERE e.createdBy = :createdBy" ) ,
    @NamedQuery( name = "ElectronicAttributeGroup.findByDateModified" , query = "SELECT e FROM ElectronicAttributeGroup e WHERE e.dateModified = :dateModified" ) ,
    @NamedQuery( name = "ElectronicAttributeGroup.findByModifiedBy" , query = "SELECT e FROM ElectronicAttributeGroup e WHERE e.modifiedBy = :modifiedBy" ) ,
    @NamedQuery( name = "ElectronicAttributeGroup.findByDisplayMask" , query = "SELECT e FROM ElectronicAttributeGroup e WHERE e.displayMask = :displayMask" ) ,
    @NamedQuery( name = "ElectronicAttributeGroup.findByDirValues" , query = "SELECT e FROM ElectronicAttributeGroup e WHERE e.dirValues = :dirValues" ) ,
    @NamedQuery( name = "ElectronicAttributeGroup.findByDirText" , query = "SELECT e FROM ElectronicAttributeGroup e WHERE e.dirText = :dirText" )
} )
public class ElectronicAttributeGroup implements Serializable
{
    private static final long serialVersionUID = 1L;
    @Id
    @Basic( optional = false )
    @Column( name = "ag_id" )
    private String agId;
    @Basic( optional = false )
    @Column( name = "ag_name" )
    private String agName;
    @Column( name = "max_length" )
    private Short maxLength;
    @Column( name = "min_length" )
    private Short minLength;
    @Column( name = "high_value_num" )
    private Long highValueNum;
    @Column( name = "low_value_num" )
    private Long lowValueNum;
    @Column( name = "initial_value" )
    private String initialValue;
    @Column( name = "ignore_reg_exp" )
    private String ignoreRegExp;
    @Column( name = "valid_reg_exp" )
    private String validRegExp;
    @Column( name = "justification" )
    private String justification;
    @Column( name = "use_in_behavior" )
    private Character useInBehavior;
    @Column( name = "option_group_parent" )
    private Character optionGroupParent;
    @Column( name = "option_group_child" )
    private Character optionGroupChild;
    @Basic( optional = false )
    @Column( name = "date_created" )
    @Temporal( TemporalType.TIMESTAMP )
    private Date dateCreated;
    @Basic( optional = false )
    @Column( name = "created_by" )
    private String createdBy;
    @Column( name = "date_modified" )
    @Temporal( TemporalType.TIMESTAMP )
    private Date dateModified;
    @Column( name = "modified_by" )
    private String modifiedBy;
    @Column( name = "display_mask" )
    private String displayMask;
    @Column( name = "dir_values" )
    private String dirValues;
    @Column( name = "dir_text" )
    private String dirText;
    @OneToMany( mappedBy = "agIdElectronic" )
    private Collection<CustomResponses> customResponsesCollection;


    public ElectronicAttributeGroup()
    {
    }


    public ElectronicAttributeGroup( String agId )
    {
        this.agId = agId;
    }


    public ElectronicAttributeGroup( String agId , String agName , Date dateCreated , String createdBy )
    {
        this.agId = agId;
        this.agName = agName;
        this.dateCreated = dateCreated;
        this.createdBy = createdBy;
    }


    public String getAgId()
    {
        return agId;
    }


    public void setAgId( String agId )
    {
        this.agId = agId;
    }


    public String getAgName()
    {
        return agName;
    }


    public void setAgName( String agName )
    {
        this.agName = agName;
    }


    public Short getMaxLength()
    {
        return maxLength;
    }


    public void setMaxLength( Short maxLength )
    {
        this.maxLength = maxLength;
    }


    public Short getMinLength()
    {
        return minLength;
    }


    public void setMinLength( Short minLength )
    {
        this.minLength = minLength;
    }


    public Long getHighValueNum()
    {
        return highValueNum;
    }


    public void setHighValueNum( Long highValueNum )
    {
        this.highValueNum = highValueNum;
    }


    public Long getLowValueNum()
    {
        return lowValueNum;
    }


    public void setLowValueNum( Long lowValueNum )
    {
        this.lowValueNum = lowValueNum;
    }


    public String getInitialValue()
    {
        return initialValue;
    }


    public void setInitialValue( String initialValue )
    {
        this.initialValue = initialValue;
    }


    public String getIgnoreRegExp()
    {
        return ignoreRegExp;
    }


    public void setIgnoreRegExp( String ignoreRegExp )
    {
        this.ignoreRegExp = ignoreRegExp;
    }


    public String getValidRegExp()
    {
        return validRegExp;
    }


    public void setValidRegExp( String validRegExp )
    {
        this.validRegExp = validRegExp;
    }


    public String getJustification()
    {
        return justification;
    }


    public void setJustification( String justification )
    {
        this.justification = justification;
    }


    public Character getUseInBehavior()
    {
        return useInBehavior;
    }


    public void setUseInBehavior( Character useInBehavior )
    {
        this.useInBehavior = useInBehavior;
    }


    public Character getOptionGroupParent()
    {
        return optionGroupParent;
    }


    public void setOptionGroupParent( Character optionGroupParent )
    {
        this.optionGroupParent = optionGroupParent;
    }


    public Character getOptionGroupChild()
    {
        return optionGroupChild;
    }


    public void setOptionGroupChild( Character optionGroupChild )
    {
        this.optionGroupChild = optionGroupChild;
    }


    public Date getDateCreated()
    {
        return dateCreated;
    }


    public void setDateCreated( Date dateCreated )
    {
        this.dateCreated = dateCreated;
    }


    public String getCreatedBy()
    {
        return createdBy;
    }


    public void setCreatedBy( String createdBy )
    {
        this.createdBy = createdBy;
    }


    public Date getDateModified()
    {
        return dateModified;
    }


    public void setDateModified( Date dateModified )
    {
        this.dateModified = dateModified;
    }


    public String getModifiedBy()
    {
        return modifiedBy;
    }


    public void setModifiedBy( String modifiedBy )
    {
        this.modifiedBy = modifiedBy;
    }


    public String getDisplayMask()
    {
        return displayMask;
    }


    public void setDisplayMask( String displayMask )
    {
        this.displayMask = displayMask;
    }


    public String getDirValues()
    {
        return dirValues;
    }


    public void setDirValues( String dirValues )
    {
        this.dirValues = dirValues;
    }


    public String getDirText()
    {
        return dirText;
    }


    public void setDirText( String dirText )
    {
        this.dirText = dirText;
    }


    @XmlTransient
    public Collection<CustomResponses> getCustomResponsesCollection()
    {
        return customResponsesCollection;
    }


    public void setCustomResponsesCollection( Collection<CustomResponses> customResponsesCollection )
    {
        this.customResponsesCollection = customResponsesCollection;
    }


    @Override
    public int hashCode()
    {
        int hash = 0;
        hash += ( agId != null ? agId.hashCode() : 0 );
        return hash;
    }


    @Override
    public boolean equals( Object object )
    {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if ( !( object instanceof ElectronicAttributeGroup ) )
        {
            return false;
        }
        ElectronicAttributeGroup other = (ElectronicAttributeGroup) object;
        if ( ( this.agId == null && other.agId != null ) || ( this.agId != null && !this.agId.equals( other.agId ) ) )
        {
            return false;
        }
        return true;
    }


    @Override
    public String toString()
    {
        return "idea.model.qnrlibrary.ElectronicAttributeGroup[ agId=" + agId + " ]";
    }
    
}
